Searches records in the grid.

<div class="definition">
    search([field], value)
</div>

<div class="arguments">
    <table>
    <tr>
        <td>field</td>
        <td><b>string</b>, <i>optional</i> name of the search field</td>
    </tr>
    <tr>
        <td>value</td>
        <td><b>string</b>, value of the search field</td>
    </tr>
    </table>
</div>

OR

<div class="definition">
    search(searches, [logic])
</div>

<div class="arguments">
    <table>
    <tr>
        <td>searches</td>
        <td><b>array</b>, array of search objects</td>
    </tr>
    <tr>
        <td>logic</td>
        <td><b>string</b>, defines search logic AND/OR (<i>optional</i>)</td>
    </tr>
    </table>
</div>

Returns <i>undefined</i>.

<h4>Description</h4>

This method will generate <a class="property" href="w2grid.searchData">.searchData</a> array of objects, apply the search and refresh the grid.
If the data source is local, it will call <a class="property" href="w2grid.localSearch">.localSearch</a> method. If the data source is remote
it will submit search data to the server side to apply the search.
<div style="height: 10px;"></div>

If the first argument <span class="argument">field</span> is string then it is the name of the
search field or 'all' to search all applicable fields (search fields where data type matches). The second argument
<span class="argument">value</span> is the search string.
<div style="height: 10px;"></div>

If the first argument is an array and second optional argument is a string (AND or OR), then the method will assume that it is the array
of search objects. This way you can submit search on multiple fields at the same time.
<div style="height: 10px;"></div>

The search object has the following structure:
<textarea class="javascript">
search = {
    field    : '',   // search field name
    value    : '',   // field value (array of two values for operators: between, in)
    type     : '',   // type of the field, if not defined search.type for the field will be used
    operator : ''    // search operator, can be 'is', 'between', 'begins with', 'contains', 'ends with'
                     // if not defined it will be selected based on the type
}
</textarea>

If you have a grid defined in the following way:
<textarea class="javascript">
let grid = new w2grid({
    name    : 'grid',
    columns: [
        { field: 'recid', text: 'ID', size: '50px' },
        { field: 'lname', text: 'Last Name', size: '30%' },
        { field: 'fname', text: 'First Name', size: '30%' },
        { field: 'email', text: 'Email', size: '40%' },
        { field: 'sdate', text: 'Start Date', size: '120px' },
        { field: 'sdate', text: 'End Date', size: '120px' }
    ],
    records: [
        { recid: 1, fname: 'John', lname: 'doe', email: 'vitali@gmail.com', sdate: '1/3/2012' },
        { recid: 2, fname: 'Stuart', lname: 'Motzart', email: 'jdoe@gmail.com', sdate: '2/4/2012' },
        { recid: 3, fname: 'Jin', lname: 'Franson', email: '--', sdate: '4/23/2012' },
        { recid: 4, fname: 'Susan', lname: 'Ottie', email: 'jdoe@gmail.com', sdate: '5/3/2012' },
        { recid: 5, fname: 'Kelly', lname: 'Silver', email: 'jdoe@gmail.com', sdate: '4/3/2012' },
        { recid: 6, fname: 'Francis', lname: 'Gatos', email: 'vitali@gmail.com', sdate: '2/5/2012' }
    ]
});
</textarea>

You can do following searches:
<textarea class="javascript">
grid.search('fname', 'm');
// or
grid.search('all', 'm');
// or
grid.search([{ field: 'date', value: ['1/1/2012', '1/10/2012'], operator: 'between'}], 'OR');
</textarea>
